//
//  OSSRequest.h
//  NiuNiuLawyer
//
//  Created by 曾永强 on 3/8/16.
//  Copyright © 2016 Beyondsoft. All rights reserved.
//

#import <Foundation/Foundation.h>

#import "OSSNWOperation.h"

typedef void(^OSSMulCompleteBlock)(BOOL isSuccess,NSArray *urls);
typedef void (^OSSNetworkingMulUploadProgressBlock) (NSInteger fileIndex,int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend);

@interface OSS_Request : NSObject

/*
 *上传的相关参数
 *localFilePath 需要上传的本地文件路径
 *localFileData 要上传的本地data
 *oss_fileName  上传到oss后的文件名称
 *uploadProgress进度显示    可以为nil
 *completeBlock 结束操作    可以为nil
 */

- (void)uploadFileAsyscToOSSWithPath:(NSString *)localFilePath destinationFileName:(NSString *)oss_fileName progressBlock:(OSSNetworkingUploadProgressBlock)uploadProgress completeHandler:(OSSCompleteBlock)completeBlock;

- (void)uploadFileAsyscToOSSWithData:(NSData *)localFileData  destinationFileName:(NSString *)oss_fileName progressBlock:(OSSNetworkingUploadProgressBlock)uploadProgress completeHandler:(OSSCompleteBlock)completeBlock;

- (void)uploadFileSyscToOSSWithPath:(NSString *)localFilePath destinationFileName:(NSString *)oss_fileName progressBlock:(OSSNetworkingUploadProgressBlock)uploadProgress completeHandler:(OSSCompleteBlock)completeBlock;

- (void)uploadFileSyscToOSSWithData:(NSData *)localFileData  destinationFileName:(NSString *)oss_fileName progressBlock:(OSSNetworkingUploadProgressBlock)uploadProgress completeHandler:(OSSCompleteBlock)completeBlock;


//同步上传多个文件data   dictionary   oss_fileName :fileData
- (void)uploadFileSyscToOSSWithData:(NSDictionary <NSString *,NSData *> *)dictionary progressBlock:(OSSNetworkingMulUploadProgressBlock)uploadProgress completeHandler:(OSSMulCompleteBlock)completeBlock;
/*
 *下载的相关参数
 *ossUrl 需要下载的oss文件路径   此处只使用了其后缀，不一定需要完整的路径
 *localFilePath 存储在本地的位置   为nil 表示默认位置
 *uploadProgress进度显示    可以为nil
 *completeBlock 结束操作    可以为nil
 */
- (void)downloadFileAsyscWithOSSUrl:(NSString *)ossUrl toLocalPath:(NSString *)localFilePath  progressBlock:(OSSNetworkingDownloadProgressBlock)downloadProgress completeHandler:(OSSCompleteBlock)completeBlock;

- (void)downloadFileSyscWithOSSUrl:(NSString *)ossUrl toLocalPath:(NSString *)localFilePath progressBlock:(OSSNetworkingDownloadProgressBlock)downloadProgress completeHandler:(OSSCompleteBlock)completeBlock;

+ (BOOL)isExistAtLocalWithFileName:(NSString *)fileName withFileSize:(NSString *)fileSizeString;
+ (NSString *)getDocPath;

@end
